package com.project.maven.demo_maven.action;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;


@RestController
@RequestMapping ( "/test" )
public class ControllerAction {
//	
//	@RequestMapping ( "/showView" )
//    public ModelAndView showView( @PathVariable() String variable1, @PathVariable ( "variable2" ) int variable2) {
//       ModelAndView modelAndView = new ModelAndView();
//       modelAndView.setViewName( "viewName" );
//       modelAndView.addObject( " 需要放到 model 中的属性名称 " , " 对应的属性值，它是一个对象 " );
//       return modelAndView;
//    }
	
	@RequestMapping( value = "/name",method = RequestMethod.POST)
	String name(@RequestParam(value = "name") String name){
		return name;
	}
	
	@RequestMapping("/hell")
	String home() {
		return "Hello World!"; // Copyright: w w w . y i I b A i.c O m
	}
	
	
}
